<template>
	<view class="sec-body">
		<view class="field-title">
			<text class="legend">查询条件</text>
			<view class="field-wrap">
				<form class="uni-form">
					<view class="uni-form-item uni-column" @tap="openPopup">
						<label class="title"><text style="color:red;">⁎</text>省份</label>
						<view class="uni-input my-picker">{{AREA_NAME}}</view>
					</view>
					<view class="uni-form-item uni-column">
						<label class="title">医疗机构</label>
						<input class="uni-input" type="text" v-model="AKB021" />
					</view>

					<navigator :url="'../hospitalList/hospitalList?id='+AKC801 +'&name='+AKB021">
						<button type="primary" style="margin-top: 30upx;width: 100%;">查询</button>
					</navigator>
				</form>
			</view>
		</view>


		<!-- 机构 -->
		<areaSelect ref="linkAddress" IS_ALL="1" :height="height" @confirmCallback="confirmCallback">
		</areaSelect>

	</view>
</template>

<script>
	import uniPopup from "@/components/uni-popup/uni-popup.vue";
	import uniTag from '@/components/uni-tag/uni-tag.vue';
	import areaSelect from '@/components/area-select/linkAddress.vue';
	export default {
		components: {
			uniPopup,
			uniTag,
			areaSelect
		},
		data() {
			return {
				isLogin: true,
				AREA_NAME: '', //就医地地区名称
				AKC801: '', //就医地地区代码
				AKB021: '', //就医地医院名称
				height: '500px',
				citySet: {
					defaultValue: [0, 0, 0]
				},
				hosIndex: [{
					AREA_CODE: '',
					AREA_NAME: '请选择'
				}, {
					AREA_CODE: '',
					AREA_NAME: ''
				}, {
					AREA_CODE: '',
					AREA_NAME: ''
				}],
				targetArr: [],
				targetIndex: 0,
				provinceArr: [],
				cityArr: [],
				areaArr: [],
				current: '',
				pageIndex: 1,

			}
		},
		computed: {
			allArr: function() {
				return [this.provinceArr, this.cityArr, this.areaArr, this.hosArr]
			}
		},
		methods: {

			//点击弹出弹窗
			openPopup: function() {
				this.height = '550rpx';
				//显示
				this.show_popup();

			},
			//显示弹窗
			show_popup: function() {
				this.$refs.linkAddress.show();
			},
			//回掉
			confirmCallback: function(select) {
				if (select) {
					var index = select.length;
					this.AKC801 = select[index - 1].AREA_CODE;
					this.AREA_NAME = select[index - 1].AREA_NAME;
				}
			}
		},

		onShow() {
			var isLogin = uni.getStorageSync('isLogin');
			this.isLogin = isLogin;
			console.log(this.isLogin)
		}
	}
</script>

<style>
	.sec-body {
		padding: 60upx;
	}

	.field-title {
		border: 2px groove #E4E7ED;
	}

	.legend {
		display: block;
		margin-top: -48upx;
		margin-left: 36upx;
		padding: 16upx 20upx;
		font-size: 20px;
		background: #fff;
	}

	.field-wrap {
		margin: 40upx 32upx;
	}

	.title {
		width: 150upx;
	}
</style>
